﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
using Windows.Storage.Streams;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Imaging;

namespace wBudget.Common
{
    class ImageLoader
    {
        public async static Task<BitmapImage> LoadImage(string path)
        {
            BitmapImage image = new BitmapImage();
            string pathPrefix = "";
            if (!Path.IsPathRooted(path))
            {
                pathPrefix = "ms-appx:///";
            }
            image.UriSource = new Uri(pathPrefix + path);
            return image;
        }
    }
}
